home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 August
/
Ahoy_Magazine_86-08_1986_Double_L.d64
/
Elegant Encoder
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
415b
|
16 lines
1 print"[147]":poke53280,6:poke53281,1:poke646,0
2 printtab(5)"commodares...elegant encoder"
3 rem solution by
4 rem frank t. smith
5 rem
10 dim m(25)
20 print"input word to be encoded"
30 get i$:if i$="" then 30
40 if i$=chr$(13) then 70
50 if i$<"@" or i$>"\" then 30
60 print i$; : n=n+1 : m(n)=asc(i$)-64 :goto 30
70 for a=1 to n:for b=1 to n:if a<>b then t=t+m(b)
80 next b
90 c$=c$+chr$(t-int(t/29)*29+64) : t=0 :next a
100 print:print"coded word is ";c$:print:print:n=0:c$="":goto 20